Getting Started with the Stock History Sample Application
To set up the Stock History sample application, first confirm that you meet the following requirements:
- Microsoft .NET Framework 1.1. This is a one-time install that allows C# and .NET Windows applications to run.
- Any version of Windows that the Microsoft .NET framework supports. The latest Flash ActiveX control. In order to ensure that the ActiveX control is installed, please visit the URL above with Internet Explorer.
- An active Internet connection is required to run the application.
- Microsoft Visual Studio .NET (recommended).
Unzip StockHistory.zip into a folder, making sure you maintain its folder structure (see Figure 1).

Figure 1. Folder structure once StockHistory.zip is uncompressed
If you are using Microsoft Visual Studio .NET, open the StockHistory\StockHistory.sln solution file to view and compile the application. Otherwise, run csc.exe to compile the application manually. This article assumes that you are using Visual Studio .NET.
Compiling the Stock History Sample Application
Open StockHistory.sln with Visual Studio .NET and make sure that the Solution Explorer is visible (View > Solution Explorer; see Figure 2).

Figure 2. Stock History solution view within Visual Studio .NET
There are two projects associated with the solution:
- Stock: This contains the Stock.cs source file, which defines the Stock class. This project creates a DLL that contains the Stock class. The Stock class encapsulates all the client/server communication necessary to retrieve the stock information.
- StockHistory: This contains the StockHistory.cs source file, which defines the StockHistory class. This is compiled into a Windows executable file, which is the main executable for the application.
No changes are required prior to compiling the application. In order to compile the entire application, select Build > Build Solution in the Solution Explorer. This places the compiled executables and DLLs on the file system. The exact location depends on the solution configuration with which you are compiling. Assuming that you are compiling with the Release configuration, locate the files here:
StockHistory\StockHistory\bin\Release
Once you compile the solution, you should find the files in the proper folder (see Figure 3).

Figure 3. The files created once you compile the solution is compiled
Running the Stock History Sample Application
Stock History loads a Macromedia Flash movie when it runs and it uses this movie to display charts about stock prices. By default, the application looks for a SWF named chart.swf in the same folder as the application's executable. Therefore, before running the application, copy chart.swf into the Compile folder. You can find chart.swf in the StockHistory\Flash folder. Just copy this file to the folder where the files were compiled. Once you've copied chart.swf, launch the application by running StockHistory.exe.
Using the Stock History Sample Application
Here's what you need to do to use the application:
- Select a start date that specifies the start date from which stock information will be retrieved.
- Select an end date that specifies the end date to which stock information will be retrieved.
- Specify a stock symbol.
- Click the Get Data button to retrieve the information.
Once Stock History retrieves the information, you can view the raw data on the Data tab or view a chart of the closing stock price on the Chart tab (see Figure 4). Now enter additional stock symbols and click Get Data to compare the stock prices over the same time period.

Figure 5. Stock History charting two stocks
To reset the Stock History application, click the Reset button.